<template>
  <el-form :model="form" ref="form" :inline="true">
    <el-form-item class="mb0" label="评语模板名称" prop="commentTemplateName">
      <el-input clearable @keyup.native.enter="handleSearch" v-model="form.commentTemplateName" />
    </el-form-item>
    <el-form-item class="mb0" label="考评环节" prop="moralityStep">
      <el-select clearable v-model="form.moralityStep">
        <el-option :value="1" label="自评" />
        <el-option :value="2" label="科室" />
        <el-option :value="3" label="党支部" />
        <el-option :value="4" label="考评委员会" />
      </el-select>
    </el-form-item>
    <el-form-item class="mb0">
      <el-tooltip class="item" content="查询" effect="dark" placement="top">
        <el-button type="primary" @click="handleSearch" icon="el-icon-search" />
      </el-tooltip>
      <el-tooltip class="item" content="重置" effect="dark" placement="top">
        <el-button @click="handleReset" icon="el-icon-refresh-right" />
      </el-tooltip>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  data() {
    return {
      form: {
        commentTemplateName: null,
        moralityStep: null,
        pageNo: 1
      }
    }
  },
  methods: {
    handleSearch() {
      this.$emit('search', this.form)
    },
    handleReset() {
      this.$refs.form.resetFields()
      this.$emit('search', this.form)
    }
  }
}
</script>
